package light.im.loginserver.action;

import java.io.IOException;

import org.json.JSONObject;

import light.im.ActionName;
import light.im.IAction;
import light.im.IMSession;
import light.network.object.PackObject;

@ActionName("echo")
public class EchoAction implements IAction {

	public String replyMsg = "";
	
	@Override
	public void execute(IMSession session, PackObject req) {
		try
		{
			JSONObject he = req.getHeader();
			System.out.println(Thread.currentThread()+" Echo server recv: "+he);
			PackObject t = new PackObject(he);
			session.write(t);
		}
		catch(IOException e)
		{
			e.printStackTrace();
		}
	}

//	@Override
//	public void fail(IMSession session, Throwable ext) {
//		ext.printStackTrace();
//	}

}
